// 传入的参数是一个函数和时间
function newInterval (fn, time) {
  function inside () {
    fn()
    setTimeout(() => {
      inside()
    }, time);
  }
  setTimeout(() => {
    inside()
  }, time);
}
function like () {
  console.log('i like you');
}
newInterval(like, 1000)